﻿
namespace WeixinSDK.Message
{
    /// <summary>
    /// 消息回复数据抽象类
    /// </summary>
    public abstract class ResData
    {
        /// <summary>
        /// 消息类型
        /// </summary>
        [System.Xml.Serialization.XmlIgnore]
        public abstract WxMsgType MsgType { get; }

        public static implicit operator ResData(string content)
        {
            return new ResText(content);
        }
    }

    /// <summary>
    /// 消息回复媒体数据抽象类
    /// </summary>
    public abstract class ResMedia : ResData
    {
        protected ResMedia() { }

        public ResMedia(string mediaId)
        {
            if (string.IsNullOrEmpty(mediaId))
                throw new System.ArgumentNullException("mediaId");

            MediaId = mediaId;
        }

        /// <summary>
        /// [必需]通过上传多媒体文件，得到的id
        /// </summary>
        public CData MediaId { get; set; }
    }
}
